package com.conceptualeyes.pubmed.search.loader;

import cn.hutool.core.lang.Console;
import com.fasterxml.jackson.databind.ObjectWriter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.item.ItemProcessor;

class PubMedArticlesS3Processor implements ItemProcessor<PubMedArticles, S3ObjectWriter.InputObject> {
    private static final Logger log = LoggerFactory.getLogger(PubMedArticlesS3Processor.class);

    ObjectWriter objectWriter;

    @Override
    public S3ObjectWriter.InputObject process(PubMedArticles pubMedArticles) {
        log.info("Converting " + pubMedArticles + " to compressed JSON");
        Console.log(pubMedArticles.toString());
        log.info("Converting " + pubMedArticles + " to compressed JSON");
        return new S3ObjectWriter.InputObject(
                pubMedArticles.name + ".json.gz",
                null);
    }
}
